﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Waiyun.WebApi
{
    public class SingleResult<T>
    {
        public T Data { get; set; }
        public bool IsSuccess { get; set; }
        public string Message { get; set; }
        public int ErrorCode { get; set; }
        public SingleResult(bool isSuccess, int errorCoe, string message, T data)
        {
            IsSuccess = isSuccess;
            ErrorCode = errorCoe;
            Message = message;
            Data = data;
        }

        public SingleResult(int errorCode, string message)
        {
            IsSuccess = false;
            ErrorCode = errorCode;
            Message = message;
        }
        public SingleResult(T data)
        {
            Data = data;
            IsSuccess = true;
        }
    }

    public class ListResult<T>
    {
        public List<T> Data { get; set; }
        public bool IsSuccess { get; set; }
        public string Message { get; set; }
        public int ErrorCode { get; set; }
        public ListResult(bool isSuccess, int errorCoe, string message, List<T> data)
        {
            IsSuccess = isSuccess;
            ErrorCode = errorCoe;
            Message = message;
            Data = data;
        }

        public ListResult(int errorCode, string message)
        {
            IsSuccess = false;
            ErrorCode = errorCode;
            Message = message;
        }
        public ListResult(List<T> data)
        {
            Data = data;
            IsSuccess = true;
        }
    }


    public class DataXStringYDecimal
    {
        public List<string> XValues { get; set; }
        public List<decimal> YValues { get; set; }
    }
    public class Data<TX, TY>
    {
        public List<TX> XValues { get; set; }
        public List<TY> YValues { get; set; }

        public Data()
        {
            XValues = new List<TX>();
            YValues = new List<TY>();
        }

    }
}
